package cn.edu.scau.cmi.ema.service.propertyEditor;

import java.beans.PropertyEditorSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import cn.edu.scau.cmi.ema.dao.Event9zwzDAO;

@Component
public class Event9zwzEditor extends PropertyEditorSupport{
	
	@Autowired
	private Event9zwzDAO event9zwzDAO;
	
	public void setAsText(String id) {
		if(id.length() > 0) {
			this.setValue(event9zwzDAO.findEvent9zwzById(Integer.parseInt(id)));
		}
		else
			this.setValue(null);
	}
}